#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <errno.h>

typedef struct S {
	char sname[20];
	int sage;
	double score;
}S;

int main() {
	// Open file
	FILE* pf = fopen("test.txt", "r");
	if (pf == NULL) {
		// printf("OprenFile::%s\n", strerror(errno));
		perror("FileOpen:");
		return 1;
	}
	printf("OpenFile::Success\n");

	//// File oparation
	//S s1 = { "QiKai", 21, 95.23 };
	//fprintf(pf, "%s %d %lf", s1.sname, s1.sage, s1.score);

	S s2 = {0};
	fscanf(pf, "%s %d %lf", s2.sname, &(s2.sage), &(s2.score));
	printf("%s %d %lf\n", s2.sname, s2.sage, s2.score);

	// Close file
	fclose(pf);
	pf = NULL;
	return 0;
}